<div class='right-cont wrap-fuser' ng-controller='DeductList'>
    <div class='title'>分成数据列表<i class='fa fa-spin fa-spinner' ng-if='loading'></i></div>
    <div class='content'>
        <ul class='nav nav-tabs nav-tabs-a'>
            <li class='active'>
                <a data-target='#list-course' data-toggle='tab'>课程售出</a>
            </li>
            <li><a data-target='#list-shopcart' data-toggle='tab'>购物车售出</a></li>
            <li><a data-target='#list-vip' data-toggle='tab'>VIP售出</a></li>
            <div class='box-search-key-date'>
                <div class='input-group input-group-date'>
                    <input type='text' class='form-control input-date' placeholder='起始时间'
                        ng-model='condition.date_start'>
                    <span class='input-group-addon'>至</span>
                    <input type='text' class='form-control input-date' placeholder='结束时间'
                        ng-model='condition.date_end'>
                </div>
                <input type='text' class='form-control input-keyword' placeholder='ID|昵称|角色'
                    ng-model='condition.keyword'>
                <button class='btn btn-primary' ng-click='get_list(1)'>搜索</button>
                <button class='btn btn-success' ng-click='out_excel()'>导出</button>
            </div>
        </ul>

        <div class='tab-content tab-content-a'>
            <div class='tab-pane fade in active' id='list-course'>
                <table class='table table-list'>
                    <tr>
                        <td>分成ID <span class='fa fa-sort'></span></td>
                        <td>微信昵称<span class='fa fa-sort'></span></td>
                        <td>真实姓名<span class='fa fa-sort'></span></td>
                        <td>交易类型<span class='fa fa-sort'></span></td>
                        <td>课程名称<span class='fa fa-sort'></span></td>
                        <td>交易金额<span class='fa fa-sort'></span></td>
                        <td>交易时间<span class='fa fa-sort'></span></td>
                        <td>分成金额<span class='fa fa-sort'></span></td>
                        <td>分成比例<span class='fa fa-sort'></span></td>
                        <td>操作<span class='fa fa-sort'></span></td>
                    </tr>
                    <tr ng-repeat='item in list'>
                        <td>{{item.id}}</td>
                        <td>{{item.nickname}}</td>
                        <td>{{item.truename}}</td>
                        <td>{{item.goods_type_text}}</td>
                        <td>{{item.course_name}}</td>
                        <td>{{item.total_amount}}</td>
                        <td>{{item.create_date}}</td>
                        <td>{{item.amount}}</td>
                        <td>{{item.percent}}</td>
                        <td>
                            <button class='btn btn-xs btn-primary' ng-click='get_item(item.money_id)'>详情</button>
                        </td>
                    </tr>
                </table>
            </div>
            <div class='tab-pane fade' id='list-shopcart'>
                <table class='table table-list'>
                    <tr>
                        <td>分成ID <span class='fa fa-sort'></span></td>
                        <td>微信昵称<span class='fa fa-sort'></span></td>
                        <td>真实姓名<span class='fa fa-sort'></span></td>
                        <td>交易类型<span class='fa fa-sort'></span></td>
                        <td>交易金额<span class='fa fa-sort'></span></td>
                        <td>交易时间<span class='fa fa-sort'></span></td>
                        <td>分成金额<span class='fa fa-sort'></span></td>
                        <td>分成比例<span class='fa fa-sort'></span></td>
                        <td>操作<span class='fa fa-sort'></span></td>
                    </tr>
                    <tr ng-repeat='item in list'>
                        <td>{{item.id}}</td>
                        <td>{{item.nickname}}</td>
                        <td>{{item.truename}}</td>
                        <td>{{item.goods_type_text}}</td>
                        <td>{{item.total_amount}}</td>
                        <td>{{item.create_date}}</td>
                        <td>{{item.amount}}</td>
                        <td>{{item.percent}}</td>
                        <td>
                            <button class='btn btn-xs btn-primary' ng-click='get_item(item.money_id)'>详情</button>
                        </td>
                    </tr>
                </table>
            </div>
            <div class='tab-pane fade' id='list-vip'>
                <table class='table table-list'>
                    <tr>
                        <td>分成ID <span class='fa fa-sort'></span></td>
                        <td>微信昵称<span class='fa fa-sort'></span></td>
                        <td>真实姓名<span class='fa fa-sort'></span></td>
                        <td>交易类型<span class='fa fa-sort'></span></td>
                        <td>交易金额<span class='fa fa-sort'></span></td>
                        <td>交易时间<span class='fa fa-sort'></span></td>
                        <td>分成金额<span class='fa fa-sort'></span></td>
                        <td>分成比例<span class='fa fa-sort'></span></td>
                        <td>操作<span class='fa fa-sort'></span></td>
                    </tr>
                    <tr ng-repeat='item in list'>
                        <td>{{item.id}}</td>
                        <td>{{item.nickname}}</td>
                        <td>{{item.truename}}</td>
                        <td>{{item.goods_type_text}}</td>
                        <td>{{item.total_amount}}</td>
                        <td>{{item.create_date}}</td>
                        <td>{{item.amount}}</td>
                        <td>{{item.percent}}</td>
                        <td>
                            <button class='btn btn-xs btn-primary' ng-click='get_item(item.money_id)'>详情</button>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class='box-page' ng-bind-html='pageHtml'></div>
    </div>
    
    <div class='modal fade get-item'>
        <div class='modal-dialog modal-lg'>
            <div class='modal-content'> 
                <div class='modal-header'>
                    交易详情
                    <a class='close' data-dismiss='modal'>&times;</a>
                </div>
                <div class='modal-body'>
                    <table class='table-info'>
                        <tr>
                            <td>付款用户:</td>
                            <td>{{nItem.nickname || '未知'}}</td>
                            <td>交易金额:</td>
                            <td>{{nItem.amount || 0}}</td>
                            <td>交易时间:</td>
                            <td>{{nItem.create_date || '未知'}}</td>
                        </tr>
                        <tr>
                            <td>交易单号:</td>
                            <td colspan='5'>{{nItem.trade_no || '未知'}}</td>
                            <!-- <td>平台利润:</td>
                            <td>{{nItem.profit || 0}}</td> -->
                        </tr>
                        <tr>
                            <td>优惠券码:</td>
                            <td colspan='3'>{{nItem.code || '无'}}</td>
                            <td>抵扣金额:</td>
                            <td>{{nItem.code_amount || '无'}}</td>
                        </tr>
                        <tr ng-repeat='deductInfo in nDeductList'>
                            <td>分成用户:</td>
                            <td>{{deductInfo.nickname || '无'}}</td>
                            <td>用户角色:</td>
                            <td>{{deductInfo.role_text || '无'}}</td>
                            <td>分红金额:</td>
                            <td>{{deductInfo.amount || '无'}}</td>
                        </tr>
                        <tr ng-if='!nDeductList'>
                            <td>分成用户:</td>
                            <td>无</td>
                            <td>用户角色:</td>
                            <td>无</td>
                            <td>分红金额:</td>
                            <td>无</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>